//Entry from boot !!!
//ok
void __attribute__((naked,noinline)) sub_FF875A0C_my() { 
        asm volatile (                
                "LDR     R12, =0x201E\n"
                "STMFD   SP!, {R4,LR}\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FF875ACC\n"
                "BGT     loc_FF875A68\n"
                "LDR     R12, =0x2004\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FF875AD4\n"
                "BGT     loc_FF875A50\n"
                "SUB     R12, R0, #0x1000\n"
                "SUBS    R12, R12, #0xA9\n"
                "SUBNE   R12, R0, #0x1000\n"
                "SUBNES  R12, R12, #0xAD\n"
                "SUBNE   R12, R0, #0x1000\n"
                "SUBNES  R12, R12, #0xAF\n"
                "BNE     loc_FF875AE4\n"
                "B       loc_FF875ACC\n"
"loc_FF875A50:\n"
                "SUB     R12, R0, #0x2000\n"
                "SUBS    R12, R12, #5\n"
                "SUBNE   R12, R0, #0x2000\n"
                "SUBNES  R12, R12, #0x1D\n"
                "BNE     loc_FF875AE4\n"
                "B       loc_FF875ACC\n"
"loc_FF875A68:\n"
                "LDR     R12, =0x5004\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FF875ACC\n"
                "BGT     loc_FF875A94\n"
                "SUB     R12, R0, #0x3000\n"
                "SUBS    R12, R12, #0xA\n"
                "BEQ     loc_FF875AC8\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #1\n"
                "BNE     loc_FF875AE4\n"
                "B       loc_FF875ACC\n"
"loc_FF875A94:\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FF875ACC\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #7\n"
                "BNE     loc_FF875AE4\n"
                "BL      sub_FF82D864\n"	//ActivateImageSystem
                "LDR     R1, =0x6008\n"
                "LDR     R0, [R1,#0x10]\n"
                "CMP     R0, #7\n"
                "LDREQ   R0, [R1,#0x18]\n"
                "BLEQ    sub_FF8765BC\n"
                "B       loc_FF875ADC\n"
"loc_FF875AC8:\n"
                "BL      sub_FF82CCF0\n"
"loc_FF875ACC:\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FF8758BC_my\n" // AC.StartupShowInfo ------->
"loc_FF875AD4:\n"
                "BL      sub_FF8746F0\n"
                "BL      sub_FF8751CC\n"	//AC.EntryNShtDwn
"loc_FF875ADC:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4,PC}\n"
"loc_FF875AE4:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
}

//ok
void __attribute__((naked,noinline)) sub_FF8758BC_my(){ // AC.StartupShowInfo
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "BL      sub_FF87670C\n"
                "CMP     R0, #1\n"
                "BLEQ    sub_FF87681C\n" 	//AC.ShowCaptInfo
                "LDR     R4, =0x6008\n"
                "MOV     R5, #1\n"
                "LDR     R0, [R4,#0x24]\n"
                "CMP     R0, #0\n"
                "LDRNE   R0, [R4,#0x4C]\n"
                "CMPNE   R0, #0\n"
                "BEQ     loc_FF875928\n"
                "BL      sub_FF87670C\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF875928\n"
                "BL      sub_FF87681C\n" 	//AC.ShowCaptInfo
                "LDR     R0, [R4,#0x78]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF875928\n"
                "LDR     R1, =0xFF875AEC\n"   // aAcStartupshowi
                "MOV     R0, #0x20\n"
                "BL      sub_FF86DA00\n"
                "BL      sub_FF9BDC58\n"
                "BL      sub_FF9BDBE4\n" 	//RefreshPhysicalScreen
                "MOV     R1, #0\n"
                "MOV     R0, #0x51\n"
                "BL      sub_FF87E814\n"
                "STR     R5, [R4,#0x78]\n"
"loc_FF875928:\n"
                "BL      sub_FF87670C\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF875974\n"
                "LDR     R0, [R4,#0x44]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF875974\n"
                "LDR     R0, [R4,#0x74]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF875974\n"
                "LDR     R1, =0xFF875B00\n"  // aAcDispshot
                "MOV     R0, #0x20\n"
                "BL      sub_FF86DA00\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x8C\n"
                "BL      sub_FF87E814\n"
                "BL      sub_FF87C994\n"
                "MOV     R0, #0x21\n"
                "BL      sub_FF87E854\n"
                "STR     R5, [R4,#0x74]\n"
"loc_FF875974:\n"
                "LDR     R0, [R4,#0x38]\n"
                "CMP     R0, #0\n"
                "LDRNE   R0, [R4,#0x3C]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x44]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x48]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x1C]\n"
                "LDRNE   R1, [R4,#0x20]\n"
                "ORRNES  R0, R0, R1\n"
                "BEQ     loc_FF8759B0\n"
                "BL      sub_FF874FDC\n" 	//AC.OpCover
                "BL      sub_FF8751CC\n"	//AC.EntryNShtDwn
                "B       loc_FF8759D4\n"
"loc_FF8759B0:\n"
                "LDR     R0, [R4,#0x58]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF8759DC\n"
                "BL      sub_FF875078\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF8759DC\n"
                "BL      sub_FF8781CC\n" 	//DispSwCon_MuteOnPhysicalScreen
                "BL      sub_FF877FEC\n"	//DispSwCon_TurnOffBackLight
                "BL      sub_FF8765F8\n"	//AC.ShutdownRec
"loc_FF8759D4:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FF8759DC:\n"
                "BL      sub_FF875078\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF875A04\n"
                "LDR     R0, [R4,#0x7C]\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FF876860_my\n" //AC.EntryRecBoot ------------->
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x70]\n"
                "STR     R0, [R4,#0x74]\n"
                "STR     R0, [R4,#0x78]\n"
"loc_FF875A04:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
);
}

//ok
void __attribute__((naked,noinline)) sub_FF876860_my(){ // AC.EntryRecBoot
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFF876A9C\n" // aAcEntryrecboot
                "MOV     R0, #0x20\n"
                "BL      sub_FF86DA00\n" 
                "BL      sub_FF82CF20\n"
                "BL      sub_FF8763F4\n"
                "BL      sub_FF87A0A4_my\n" //StartRecMode ------------->
                "MOV     R0, #1\n"
                "BL      sub_FF874A74\n"
                "BL      sub_FF874F60\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FF87522C\n"
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF87A0A4_my(){ // StartRecMode
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R1, =0xFF87A2A0\n" // aStartrecmode
                "MOV     R0, #0x20\n"
                "BL      sub_FF86DA00\n" 
                "LDR     R4, =0x62A8\n"
                "MOV     R0, #6\n"
                "MOV     R5, #1\n"
                "STR     R0, [R4,#0x60]\n"
                "STR     R5, [R4,#0x10]\n"
                "BL      sub_FF9583D0\n"
                "BL      sub_FF96F128\n"
                "BL      sub_FF95FAD8\n"
                "BL      sub_FF95D0F8\n"		
                "BL      sub_FF87A5E4_my\n"  //------------->
                "BL      sub_FF96FDC8\n"
                "BL      sub_FF96C37C\n"
				"BL      sub_FF96F020\n" 
                "MOV     R0, #1\n"
                "STR     R5, [R4,#0x1c]\n"
                "BL      sub_FF87A6F4\n" 
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x6C]\n"
                "LDR     R1, [R4,#0x70]\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF87A5E4_my(){ // 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "MOV     R0, #1\n"
                "BL      sub_FF960594\n"
                "LDR     R0, =0x855\n"
                "BL      sub_FF872854\n"
                "BL      sub_FF82CCF0\n"
                //"BL      sub_FF879E74\n"  
                "BL      sub_FF879E74_my\n"  //-------------->
                "BL      sub_FF957BD0\n"
                "BL      sub_FF952920\n"  
                "BL      sub_FF95E534\n" 
                "BL      sub_FF961F64\n"
                "BL      sub_FF962648\n"
                "BL      sub_FF96BC00\n"
                "BL      sub_FF9712CC\n" 
                "BL      sub_FF963780\n" 
                "BL      sub_FF96F5A4\n"
                "BL      sub_FF96ECA8\n"
                "BL      sub_FF962190\n" 
                "BL      sub_FF96E5F0\n"
                "BL      sub_FF9603F8\n" 
				"BL      sub_FF96B7E8\n" 
				"BL      sub_FF96B2EC\n"
				"BL      sub_FF95DE84\n" 
				"BL      sub_FF96DC0C\n"
				"BL      sub_FF87E9A0\n" 
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FF87E650\n" 
 );
} 

// branches are together
//OK
void __attribute__((naked,noinline)) sub_FF879E74_my(){  // 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R0, =0x631C\n"
                //"LDR     R1, =0xFF879BEC\n" 
                "LDR     R1, =sub_FF879BEC_my\n" // __PrepareCaptureModeChange__ ------------->
                "BL      sub_FF88045C\n" 
                "LDR     R1, =0x62A8\n"
                //"LDR     R0, =0xFF879D28\n" 
                "LDR     R0, =sub_FF879D28_my\n" //------------->
                "STR     R0, [R1,#0x70]\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 

//branch 1
//ok
void __attribute__((naked,noinline)) sub_FF879BEC_my(){ // __PrepareCaptureModeChange__
 asm volatile(
 
                "STMFD   SP!, {R3-R5,LR}\n"
                "BL      sub_FF951628\n"
                "BL      sub_FF970F88\n"
                "LDR     R4, =0x62A8\n"
                "LDR     R0, [R4,#0x34]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF879C28\n"
                "LDR     R1, =0xFF879D08\n"			//a__preparecaptu 
                "MOV     R0, #0x20\n"
                "BL      sub_FF86DA00\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x34]\n"
                "STR     R0, [R4,#0x30]\n"
                "BL      sub_FF879B00\n"		//ShutdownRecMode
                "LDMFD   SP!, {R3-R5,PC}\n"
"loc_FF879C28:\n"
                "BL      sub_FF826E78\n"		//SSAPI.PrepareCaptureModeChange
                "LDRH    R0, [R4,#4]\n"
                "SUB     R12, R0, #0x8200\n"
                "SUBS    R12, R12, #0xA\n"
                "BNE     loc_FF879C4C\n"
                "MOV     R0, #0x24\n"
                "BL      sub_FF87E854\n"
                "MOV     R0, #0x25\n"
                "BL      sub_FF87E854\n"
"loc_FF879C4C:\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, SP\n"
                "STRH    R0, [SP]\n"
                "LDR     R0, [R4,#0x60]\n"
                "STRH    R0, [SP,#2]\n"
                "MOV     R0, #0x40\n"
                "BL      sub_FF87E814\n"
                "LDR     R0, [R4,#0x20]\n"
                "CMP     R0, #0\n"
                "LDREQH  R0, [R4,#4]\n"
                "BLEQ    sub_FF873B38\n"		//PTM_SetCurrentCaptureMode
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, #1\n"
                //"BL      sub_FF878FD4\n"		
                "BL      sub_FF878FD4_my\n" //_DecideCaptureMode----------->
                "LDR     R0, [R4,#0x6C]\n"
                "BL      sub_FF87A6F4\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x6C]\n"
                "LDR     R1, [R4,#0x70]\n"
                "ADD     SP, SP, #4\n"
                "LDMFD   SP!, {R4,R5,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 

//branch 2
//OK
void __attribute__((naked,noinline)) sub_FF879D28_my(){  // was FFC61F54
 asm volatile(

                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R5, =0x62A8\n"
                "LDRH    R0, [R5,#4]\n"
                "BL      sub_FF95FD18\n"
                "BL      sub_FF95D330\n"
                "BL      sub_FF96224C\n"
                "BL      sub_FF9638B8\n"
                "BL      sub_FF96BDCC\n"
                "BL      sub_FF950E28\n"
                "BL      sub_FF9605DC\n"
                "MOV     R4, #0\n"
                "MOV     R0, R4\n"
                "STR     R4, [R5,#0x28]\n"
                "BL      sub_FF826EB4\n"		//SSAPI.CaptureModeChange
                "LDR     R0, [R5,#0x14]\n"
                "LDR     R6, =0x313D\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF879DA0\n"
                "BL      sub_FF870768\n"
                "STR     R0, [R5,#0x5C]\n"
                "STR     R4, [R5,#0x1C]\n"
                "STR     R4, [R5,#0x14]\n"
                "STR     R4, [R5,#0x30]\n"
                "MOV     R0, #0xC\n"
                "STR     R4, [R5,#0x24]\n"
                "BL      sub_FF83EEE0\n"
                "MOV     R0, R6\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R1, #0\n"
                "B       sub_FF8711D8\n"		//PostLogicalEventToUI 
"loc_FF879DA0:\n"
                //"BL      nullsub_98\n"
                "STR     R4, [R5,#0x40]\n"
                "LDRH    R0, [R5,#4]\n"
                "MOV     R1, #0\n"
                //"BL      sub_FF878FD4\n" 	
                "BL      sub_FF878FD4_my\n" 	//_DecideCaptureMode ----------->
                "BL      sub_FF87C994\n"
                "LDR     R0, [R5,#0x64]\n"
                "CMP     R0, #0\n"
                "STRNE   R4, [R5,#0x64]\n"
                "BLNE    sub_FF87A334\n"		//_MuteOffStitch
                "BL      sub_FF95DF58\n"
                "BL      sub_FF95E5FC\n"
                "LDR     R1, [R5,#0x60]\n"
                "MOV     R0, #0x41\n"
                "BL      sub_FF87E814\n"
                "BL      sub_FF87A334\n"			//_MuteOffStitch
                "BL      sub_FF95D2F0\n"
                "BL      sub_FF958544\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FF95D334\n"		//j_UnpressZoomLever
                "BL      sub_FF95FCA0\n"
                "BL      sub_FF951498\n"
                "BL      sub_FF870768\n"
                "STR     R0, [R5,#0x5C]\n"
                "LDR     R0, [R5,#0x14]\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #0xC\n"
                "STRNE   R4, [R5,#0x14]\n"
                "BLNE    sub_FF83EEE0\n"
                "LDR     R0, =0x8003\n"
                "STR     R4, [R5,#0x30]\n"
                "BL      sub_FF873C9C\n"		//PTM_GetCurrentItem
                "STRH    R0, [R5]\n"
                "MOV     R0, R6\n"
                "MOV     R1, #0\n"
                "BL      sub_FF8711D8\n"		//PostLogicalEventToUI 
                "BL      sub_FF87A500\n"
                "LDR     R0, [R5,#0x34]\n"
                "CMP     R0, #1\n"
                "STREQ   R4, [R5,#0x34]\n"
                "LDMEQFD SP!, {R4-R6,LR}\n"
                "BEQ     sub_FF879B00\n"		//ShutdownRecMode
                "LDMFD   SP!, {R4-R6,PC}\n"
				
 );
} 

//branches are joining here
//ok
void __attribute__((naked,noinline)) sub_FF878FD4_my(){ // _DecideCaptureMode
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "MOV     R5, R0\n"
                "MOV     R4, R1\n"
                "LDR     R1, =0XFF8791CC\n"		//a_decidecapture 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "LDR     R6, =0x62A8\n"
                "LDR     R0, [R6,#0x10]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF87918C\n"
                "LDR     R0, [R6,#0x1C]\n"
                "LDR     R1, =0x820A\n"
                "LDR     R2, =0XFFFE0000\n"		// FF8791E8 ??? aVer_008_006
                "CMP     R0, #1\n"
                "BNE     loc_FF879054\n"
                "CMP     R4, #1\n"
                "LDMEQFD SP!, {R4-R6,PC}\n"
                "CMP     R4, #0\n"
                "BNE     loc_FF879054\n"
                "CMP     R5, R1\n"
                "BNE     loc_FF879034\n"
                "BL      sub_FF87A5E0\n"
                "BL      sub_FF87A378\n"		//_StartStitch
                "B       loc_FF87918C\n"
"loc_FF879034:\n"
                "CMP     R2, R5,LSL#17\n"
                "TSTNE   R5, #0xC00\n"
                "BEQ     loc_FF879048\n"
                //"BL      SUB_FF87A420\n"		
                "BL      sub_FF87A420_my\n" // _StartMovie------------->
                "B       loc_FF87904C\n"

"loc_FF879048:\n"
                "BL      sub_FF87A3D4\n"				//_StartStill
"loc_FF87904C:\n"
                "BL      sub_FF87A5E0\n"
                "B       loc_FF87918C\n"
"loc_FF879054:\n"
                "CMP     R5, R1\n"
                "BNE     loc_FF8790A8\n"
                "LDRH    R0, [R6,#2]\n"
                "CMP     R0, R1\n"
                "BEQ     loc_FF879184\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FF87908C\n"
                "LDR     R1, =0xFF8791EC\n"			//a_movietostitch 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FF87915C\n"
                "B       loc_FF8790A0\n"
"loc_FF87908C:\n"
                "LDR     R1, =0xFF8791FC\n"		//a_stilltostitch 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FF879178\n"
"loc_FF8790A0:\n"
                "BL      sub_FF87A378\n"				//_StartStitch
                "B       loc_FF879184\n"
"loc_FF8790A8:\n"
                "CMP     R2, R5,LSL#17\n"
                "LDRH    R0, [R6,#2]\n"
                "TSTNE   R5, #0xC00\n"
                "BEQ     loc_FF879118\n"
                "CMP     R0, R1\n"
                "BNE     loc_FF8790D8\n"
                "LDR     R1, =0xFF87920C\n"		//a_stitchtomovie 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FF879134\n"
                "B       loc_FF879110\n"
"loc_FF8790D8:\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FF8790FC\n"
                "LDR     R1, =0xFF87921C\n"			//a_movietomovie 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FF87915C\n"
                "B       loc_FF879110\n"
"loc_FF8790FC:\n"
                "LDR     R1, =0xFF87922C\n"		//a_stilltomovie 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FF879178\n"
"loc_FF879110:\n"
                //"BL      sub_FF87A420\n"				
                "BL      sub_FF87A420_my\n" // _StartMovie------------->
                "B       loc_FF879184\n"
"loc_FF879118:\n"
                "CMP     R0, R1\n"
                "BNE     loc_FF87913C\n"
                "LDR     R1, =0xFF87923C\n"			//a_stitchtostill
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "CMP     R4, #1\n"
                "BNE     loc_FF879180\n"
"loc_FF879134:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FF87A3A8\n"				//_StopStitch
"loc_FF87913C:\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FF879164\n"
                "LDR     R1, =0xFF87924C\n"			//a_movietostill 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "CMP     R4, #1\n"
                "BNE     loc_FF879180\n"
"loc_FF87915C:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FF87A44C\n"			//_StopMovie
"loc_FF879164:\n"
                "LDR     R1, =0xFF87925C\n"			//a_stilltostill 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "CMP     R4, #1\n"
                "BNE     loc_FF879180\n"
"loc_FF879178:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FF87A3FC\n"			//_StopStill
"loc_FF879180:\n"
                "BL      sub_FF87A3D4\n"			//_StartStill
"loc_FF879184:\n"
                "CMP     R4, #0\n"
                "LDMNEFD SP!, {R4-R6,PC}\n"
"loc_FF87918C:\n"
                "STRH    R5, [R6,#2]\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
} 


//ok
void __attribute__((naked,noinline)) sub_FF87A420_my(){  // _StartMovie
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFF87A56C\n" // a_startmovie
                "MOV     R0, #0x20\n"
                "BL      sub_FF86DA00\n" 
                "LDR     R0, =0x62A8\n"
                "LDR     R0, [R0,#0x2c]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FF87B1FC\n"
                "LDMFD   SP!, {R4,LR}\n"
                "MOV     R0, #0\n"
                //"B       sub_FF87D9BC\n"  
                "B       sub_FF87D9BC_my\n"  // ----------->
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF87D9BC_my(){  // 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R4, =0x6470\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x30]\n"
                "LDR     R0, [R4,#8]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF87D9E8\n"
                "LDR     R0, =sub_FF87D5A0_my\n" //----------->
                "MOV     R1, #0\n"
                "BL      sub_FF8709DC\n" 
                "STR     R0, [R4,#8]\n"
"loc_FF87D9E8:\n"
                "LDR     R0, [R4,#0xC]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF87DA04\n"
                "LDR     R0, =0xFF87D238\n"
                "MOV     R1, #0\n"
                "BL      sub_FF879FC4\n"
                "STR     R0, [R4,#0xC]\n"
"loc_FF87DA04:\n"
                "BL      sub_FF87E1C0\n"
                "BL      sub_FF87D29C\n"
                "BL      sub_FF96C950\n"
                "BL      sub_FF971DD0\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FF95F258\n"
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF87D5A0_my(){  // 
 asm volatile(
                "STMFD   SP!, {R3-R11,LR}\n"
                "LDR     R5, =0x6470\n"
                "MOV     R4, R1\n"
                "LDR     R2, [R5,#0x2C]\n"
                "ADD     R0, R5, #0\n"
                "LDR     R0, [R0,#0x14]\n"
                "LDR     R9, =0x3007\n"
                "CMP     R2, #0\n"
                "MOV     R1, #0\n"
                "MOV     R11, R3\n"
                "MVN     R8, #0\n"			//                "MOVL    R8, 0xFFFFFFFF\n"
                "BEQ     loc_FF87D618\n"
                "CMP     R4, R9\n"
                "BEQ     loc_FF87D830\n"
                "CMP     R4, #0x800\n"
                "LDREQ   R2, [R5,#0x38]\n"
                "CMPEQ   R11, R2\n"
                "BNE     loc_FF87D940\n"
                "STR     R1, [R5,#0x2C]!\n"
                "CMP     R0, #0\n"
                "STR     R8, [R5,#0xC]\n"
                "BNE     loc_FF87D9B4\n"
                "BL      sub_FF82D7A0\n"
                "CMP     R0, #1\n"
                "BEQ     loc_FF87D610\n"
                "BL      sub_FF82D7A8\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF87D9B4\n"
"loc_FF87D610:\n"
                "BL      sub_FF87D3E8\n"
                "B       loc_FF87D9B4\n"
"loc_FF87D618:\n"
                "CMP     R0, #1\n"
                "SUBEQ   R12, R4, #0x2000\n"
                "SUBEQS  R12, R12, #0x1C\n"
                "BNE     loc_FF87D634\n"
                "MOV     R0, #0\n"
                "BL      sub_FF87DC70\n"		//MviCon_EmpBuf
                "B       loc_FF87D9B4\n"
"loc_FF87D634:\n"
                "BL      sub_FF894488\n"
                "LDR     R10, =0x9A5\n"
                "CMP     R0, #1\n"
                "SUB     R6, R10, #4\n"
                "SUB     R7, R10, #2\n"
                "BNE     loc_FF87D668\n"
                "CMP     R4, R10\n"
                "CMPNE   R4, R6\n"
                "CMPNE   R4, R7\n"
                "BNE     loc_FF87D668\n"
                "BL      sub_FF893614\n"
                "STR     R4, [R5,#0x3C]\n"
                "B       loc_FF87D940\n"
"loc_FF87D668:\n"
                "BL      sub_FF95D108\n"		//GetAEIntegralServiceMode_7
                "CMP     R0, #1\n"
                "BNE     loc_FF87D688\n"		//           vas     "BNE     sub_FF87D688\n"
                "MOV     R0, R4\n"
                "BL      sub_FF870F18\n"
                "CMP     R0, #1\n"
                "CMPNE   R4, R10\n"
                "BEQ     loc_FF87D940\n"
"loc_FF87D688:\n"
                "BL      sub_FF82D8A0\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF87D6A0\n"
                "CMP     R4, R6\n"
                "CMPNE   R4, R7\n"
                "BEQ     loc_FF87D9B4\n"
"loc_FF87D6A0:\n"
                "BL      sub_FF87A198\n"
                "LDR     R1, =0x9A2\n"
                "CMP     R0, #1\n"
                "ADD     R2, R1, #2\n"
                "BNE     loc_FF87D6C8\n"
                "CMP     R4, R6\n"
                "CMPNE   R4, R1\n"
                "CMPNE   R4, R7\n"
                "CMPNE   R4, R2\n"
                "BEQ     loc_FF87D9B4\n"
"loc_FF87D6C8:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x57\n"
                "BNE     loc_FF87D6F0\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORR     R0, R0, R1\n"
                "LDR     R1, [R5,#0x1C]\n"
                "ORRS    R0, R0, R1\n"
                "BLEQ    sub_FF9ABF9C\n"
                "B       loc_FF87D9B4\n"
"loc_FF87D6F0:\n"
                "LDR     R12, =0x200A\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FF87D9A4\n"
                "BGT     loc_FF87D76C\n"
                "LDR     R12, =0x907\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #2\n"
                "MOVEQ   R0, R10\n"
                "BEQ     loc_FF87D8E0\n"
                "BGT     loc_FF87D748\n"
                "SUB     R12, R4, #0x800\n"
                "LDR     R6, =0x2003\n"
                "SUBS    R12, R12, #0x26\n"
                "BEQ     loc_FF87D844\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x29\n"
                "BEQ     loc_FF87D888\n"
                "CMP     R4, #0x860\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x61\n"
                "BNE     loc_FF87D958\n"
                "B       loc_FF87D940\n"
"loc_FF87D748:\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FF87D8D8\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FF87D9A4\n"
                "CMP     R4, R7\n"
                "BEQ     loc_FF87D8D8\n"
                "CMP     R4, R2\n"
                "BEQ     loc_FF87D9A4\n"
                "B       loc_FF87D958\n"
"loc_FF87D76C:\n"
                "LDR     R12, =0x3149\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #0\n"
                "MOVEQ   R0, #0x84\n"
                "BEQ     loc_FF87D950\n"
                "BGT     loc_FF87D7C4\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #0x20\n"
                "MOVEQ   R1, R11\n"
                "MOVEQ   R0, #0x83\n"
                "BEQ     loc_FF87D950\n"
                "CMP     R4, R9\n"
                "BEQ     loc_FF87D81C\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x35\n"
                "BEQ     loc_FF87D800\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #0x148\n"
                "BNE     loc_FF87D958\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x86\n"
                "B       loc_FF87D950\n"
"loc_FF87D7C4:\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FF87D948\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #3\n"
                "BEQ     loc_FF87D904\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #8\n"
                "BEQ     loc_FF87D8E8\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #0xF\n"
                "BNE     loc_FF87D958\n"
                "MOV     R0, #0x82\n"
                "BL      sub_FF87E854\n"
                "B       loc_FF87D9B4\n"
"loc_FF87D800:\n"
                "BL      sub_FF87E1F4\n"	//GetVRAMHPixelsSize_1
                "CMP     R0, #4\n"
                "BEQ     loc_FF87D9A4\n"
                "LDR     R0, [R5,#0x1C]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FF87D330\n"	//MviCon_ShtDwn
                "B       loc_FF87D9B4\n"
"loc_FF87D81C:\n"
                "MOV     R0, #1\n"
                "STR     R0, [R5,#0x1C]\n"
                "LDR     R0, [R5,#0x18]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF87D838\n"
"loc_FF87D830:\n"
                "BL      sub_FF87D330\n"	//MviCon_ShtDwn
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FF87D838:\n"
                "MOV     R0, R4\n"
                "BL      sub_FF87D508\n"
                "B       loc_FF87D9B4\n"
"loc_FF87D844:\n"
                "BL      sub_FF87A198\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF87D85C\n"
                "MOV     R0, R4\n"
                "BL      sub_FF87A18C\n"
                "B       loc_FF87D9B4\n"
"loc_FF87D85C:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORR     R0, R0, R1\n"
                "LDR     R1, [R5,#0x1C]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FF87D9B4\n"
                "MOV     R1, #0\n"
                "MOV     R0, R6\n"
                "BL      sub_FF85E584\n"
                "BL      sub_FF99B540\n" 		// StartRecModeMenu
                "B       loc_FF87D9B4\n"
"loc_FF87D888:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FF87D9B4\n"
                "BL      sub_FF87A1A4\n"
                "CMP     R0, #0\n"
                "LDREQ   R0, [R5,#0x1C]\n"
                "CMPEQ   R0, #0\n"
                "BNE     loc_FF87D9B4\n"
                "BL      sub_FF87A198\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF87D9B4\n"
                "BL      sub_FF971E7C\n" // j_IsEvfDriveMode_17
                "CMP     R0, #0\n"
                "BNE     loc_FF87D9B4\n"
                "MOV     R1, #0\n"
                "MOV     R0, R6\n"
                "BL      sub_FF85E584\n"
                "BL      sub_FF9523F4\n"
                "B       loc_FF87D9B4\n"
"loc_FF87D8D8:\n"
                "MOV     R1, #1\n"
                "MOV     R0, R4\n"
"loc_FF87D8E0:\n"
                //"BL      sub_FF87D444\n"
                "BL      sub_FF87D444_my\n" // MviCon_fShtDwn------------->
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FF87D8E8:\n"
                "MOV     R0, R11\n"
                "BL      sub_FF878A18\n"
                "CMP     R0, #0\n"
                "MOVEQ   R1, R11\n"
                "MOVEQ   R0, R4\n"
                //"BLEQ    sub_FF87DE60\n"
                "BLEQ    sub_FF87DE60_my\n"  //----------->
                "B       loc_FF87D940\n"
"loc_FF87D904:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMN     R0, #1\n"
                "BEQ     loc_FF87D940\n"
                "MOV     R0, #0\n"
                "BL      sub_FF890150\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMP     R0, R6\n"
                "BNE     loc_FF87D930\n"
                "BL      sub_FF82D7A0\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF87D93C\n"
"loc_FF87D930:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "MOV     R1, #0\n"
                "BL      sub_FF87118C\n"		//PostLogicalEventForNotPowerType
"loc_FF87D93C:\n"
                "STR     R8, [R5,#0x3C]\n"
"loc_FF87D940:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FF87D948:\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x85\n"
"loc_FF87D950:\n"
                "BL      sub_FF87E814\n"
                "B       loc_FF87D9B4\n"
"loc_FF87D958:\n"
                "LDR     R12, =0x855\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FF87D994\n"
                "BGT     loc_FF87D980\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x38\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x39\n"
                "BNE     loc_FF87D9A4\n"
                "B       loc_FF87D994\n"
"loc_FF87D980:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x56\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x5D\n"
                "BNE     loc_FF87D9A4\n"
"loc_FF87D994:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FF87D9B4\n"
"loc_FF87D9A4:\n"
                "MOV     R1, R11\n"
                "MOV     R0, R4\n"
                //"BL      sub_FF87DE60\n"
                "BL      sub_FF87DE60_my\n"  //----------------->
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FF87D9B4:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R3-R11,PC}\n"
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF87D444_my(){ // MviCon_fShtDwn
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "MOV     R4, R0\n"
                "LDR     R0, =0x6470\n"
                "MOV     R5, R1\n"
                "LDR     R0, [R0,#0x1C]\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0xFF87D57C\n" // aMvicon_fshtdwn 
                "BNE     loc_FF87D4F0\n"
                "BL      sub_FF87E200\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF87D480\n"
"loc_FF87D470:\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R1, #0\n"
                //"B       sub_FF87DE60\n"
                "B       sub_FF87DE60_my\n" //------------->
 "loc_FF87D480:\n"
                "CMP     R5, #2\n"
                "BNE     loc_FF87D498\n"
                "BL      sub_FF87C994\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF87D4E0\n"
                "B       loc_FF87D4AC\n"
"loc_FF87D498:\n"
                "CMP     R5, #1\n"
                "BNE     loc_FF87D4E0\n"
                "BL      sub_FF87C9AC\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF87D4E0\n"
"loc_FF87D4AC:\n"
                "MOV     R0, #0\n"
                "BL      sub_FF890150\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA1\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA3\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA5\n"
                "LDREQ   R0, =0xC507\n"
                "MOVEQ   R1, #0\n"
                "BLEQ    sub_FF85E584\n"
"loc_FF87D4D8:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FF87D4E0:\n"
                "BL      sub_FF87D3E8\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF87D4FC\n"
                "LDR     R1, =0xFF87D58C\n" //  aMvicon_initchk 
"loc_FF87D4F0:\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "B       loc_FF87D4D8\n"
"loc_FF87D4FC:\n"
                "MOV     R0, R5\n"
                "BL      sub_FF95BE8C\n"
                "B       loc_FF87D470\n"
 );
}

//ok
void __attribute__((naked,noinline)) sub_FF87DE60_my(){  //
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"				
                "MOV     R7, R1\n"
                "MOV     R4, R0\n"
                "BL      sub_FF87E27C\n"
                "LDR     R5, =0x64B4\n"
                "LDR     R3, =0x200A\n"
                "LDR     R12, [R5]\n"
                "LDR     R2, =0x4008\n"
                "LDR     R6, =0x9A3\n"
                "LDR     R0, =0x3007\n"
                "LDR     R1, =0x1051\n"
                "CMP     R12, #9\n"
                "ADD     LR, R3, #0x15\n"
                "ADDLS   PC, PC, R12,LSL#2\n"
                "B       loc_FF87E1B8\n"
"loc_FF87DE9C:\n"
                "B       loc_FF87DEC4\n"
"loc_FF87DEA0:\n"
                "B       loc_FF87DED4\n"
"loc_FF87DEA4:\n"
                "B       loc_FF87DEE4\n"
"loc_FF87DEA8:\n"
                "B       loc_FF87DF58\n"
"loc_FF87DEAC:\n"
                "B       loc_FF87DF98\n"
"loc_FF87DEB0:\n"
                "B       loc_FF87E020\n"
"loc_FF87DEB4:\n"
                "B       loc_FF87E050\n"
"loc_FF87DEB8:\n"
                "B       loc_FF87E100\n"
"loc_FF87DEBC:\n"
                "B       loc_FF87E060\n"
"loc_FF87DEC0:\n"
                "B       loc_FF87E128\n"
"loc_FF87DEC4:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FF87DDE8\n"	//_ActionPrepareCapture
"loc_FF87DED4:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                //B       sub_FF87E3F8
                "B       sub_FF87E3F8_my\n"  //    ------------>
"loc_FF87DEE4:\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FF87DF48\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FF87DF0C\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FF87DF50\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FF87E1B8\n"
"loc_FF87DF0C:\n"
                "BL      sub_FF87D3C4\n"	//MviCon_ext
                "MOV     R0, #0\n"
                "BL      sub_FF87E264\n"	//MovieState
                "LDR     R0, [R5,#8]\n"
                "CMP     R0, #0\n"
                "MOVNE   R1, #0\n"
                "MOVNE   R0, R6\n"
                "BNE     loc_FF87DF40\n"
                "LDR     R0, [R5,#4]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF87E168\n"
                "LDR     R0, =0x9A1\n"
                "MOV     R1, #0\n"
"loc_FF87DF40:\n"
                "BL      sub_FF87DDE8\n"	//_ActionPrepareCapture
                "B       loc_FF87E168\n"
"loc_FF87DF48:\n"
                "BL      sub_FF87E36C\n"
                "B       loc_FF87E168\n"
"loc_FF87DF50:\n"
                "BL      sub_FF87E384\n"
                "B       loc_FF87E168\n"
"loc_FF87DF58:\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FF87DF88\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FF87DF80\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FF87DF90\n"
                "CMP     R4, R0\n"
                "BLEQ    sub_FF87E384\n"
                "B       loc_FF87E1B8\n"
"loc_FF87DF80:\n"
                //BL      _EntryActionOnPreMoving
                "BL      sub_FF87DD8C_my\n"  //_EntryActionOnPreMoving---------------->
                "B       loc_FF87E1B8\n"
"loc_FF87DF88:\n"
                "BL      sub_FF87E34C\n"
                "B       loc_FF87E1B8\n"
"loc_FF87DF90:\n"
                "BL      sub_FF87E36C\n"
                "B       loc_FF87E1B8\n"
"loc_FF87DF98:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FF87DFF4\n"
                "BGT     loc_FF87DFC0\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FF87DFDC\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FF87E00C\n"
"loc_FF87DFB4:\n"
                "CMP     R4, R3\n"
                "BNE     loc_FF87E1B8\n"
                "B       loc_FF87DFD0\n"
"loc_FF87DFC0:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FF87E000\n"
"loc_FF87DFC8:\n"
                "CMP     R4, R2\n"
                "BNE     loc_FF87E1B8\n"
"loc_FF87DFD0:\n"
                "BL      sub_FF87E3D4\n"	//_ActionStopRecordMovie
                "BL      sub_FF87E34C\n"
                "B       loc_FF87E168\n"
"loc_FF87DFDC:\n"
                "BL      sub_FF829154\n"	//SSAPI.StopRecordMovie
                "MOV     R0, #5\n"
                "BL      sub_FF87E264\n"	//MovieState
                "MOV     R0, #0\n"
                "STR     R0, [R5,#0xC]\n"
                "B       loc_FF87E168\n"
"loc_FF87DFF4:\n"
                "MOV     R0, #5\n"
                "BL      sub_FF87E264\n"	//MovieState
                "B       loc_FF87E044\n"
"loc_FF87E000:\n"
                "BL      sub_FF829154\n"	//SSAPI.StopRecordMovie
                "BL      sub_FF87E3D4\n"	//_ActionStopRecordMovie
                "B       loc_FF87E0F8\n"
"loc_FF87E00C:\n"
                "BL      sub_FF829154\n"	//SSAPI.StopRecordMovie
                "BL      sub_FF87E3D4\n"	//_ActionStopRecordMovie
                "B       loc_FF87E058\n"
"loc_FF87E018:\n"
                "BL      sub_FF87E264\n"	//MovieState
                "B       loc_FF87E168\n"
"loc_FF87E020:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FF87E044\n"
                "BGT     loc_FF87E038\n"
                "CMP     R4, R1\n"
                "BNE     loc_FF87DFB4\n"
                "B       loc_FF87E058\n"
"loc_FF87E038:\n"
                "CMP     R4, R0\n"
                "BNE     loc_FF87DFC8\n"
                "B       loc_FF87E0F8\n"
"loc_FF87E044:\n"
                "MOV     R0, R7\n"
                "BL      sub_FF87E3A0\n"	//_dsi_StopRecordMovie
                "B       loc_FF87E168\n"
"loc_FF87E050:\n"
                "CMP     R4, R1\n"
                "BNE     loc_FF87E1B8\n"
"loc_FF87E058:\n"
                "MOV     R0, #8\n"
                "B       loc_FF87E018\n"
"loc_FF87E060:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FF87E0F8\n"
                "BGT     loc_FF87E0E4\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FF87DF48\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FF87E044\n"
                "B       loc_FF87E1B8\n"
"loc_FF87E0E4:\n"
                "CMP     R4, R2\n"
                "SUBNE   R12, R4, #0x4000\n"
                "SUBNES  R12, R12, #0xE\n"
                "BEQ     loc_FF87DF48\n"
                "B       loc_FF87E1B8\n"
"loc_FF87E0F8:\n"
                "MOV     R0, #7\n"
                "B       loc_FF87E018\n"
"loc_FF87E100:\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FF87E118\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FF87E044\n"
                "CMP     R4, R2\n"
                "BNE     loc_FF87E1B8\n"
"loc_FF87E118:\n"
                "BL      sub_FF87E34C\n"
                "MOV     R0, #0\n"
                "BL      sub_FF87D508\n"
                "B       loc_FF87E168\n"
"loc_FF87E128:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FF87E170\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FF87E1A8\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FF87E198\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x2A\n"
                "BNE     loc_FF87E1B8\n"
                "BL      sub_FF87E304\n"
                "LDR     R0, [R5,#0x14]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF87E168\n"
                //BL      _EntryActionOnMoving
                "BL      sub_FF87E320_my\n"  //_EntryActionOnMoving---------------->
                "BL      sub_FF95D114\n"
"loc_FF87E168:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FF87E170:\n"
                "BL      sub_FF87E304\n"
                "LDR     R0, =0x8007\n"
                "MOV     R1, #0\n"
                "BL      sub_FF873C90\n" 	//j_PTM_SetCurrentItem
                "BL      sub_FF95BE2C\n"
                "BL      sub_FF87E34C\n"
                "BL      sub_FF95D114\n"
                "BL      sub_FF87D3C4\n"	//MviCon_ext
                "MOV     R0, #0\n"
                "B       loc_FF87E018\n"
"loc_FF87E198:\n"
                "BL      sub_FF87E304\n"
                "BL      sub_FF95BE2C\n"
                "BL      sub_FF95D114\n"
                "B       loc_FF87DF50\n"
"loc_FF87E1A8:\n"
                "BL      sub_FF87E304\n"
                "BL      sub_FF95BE2C\n"
                "BL      sub_FF95D114\n"
                "B       loc_FF87DF48\n"
"loc_FF87E1B8:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
                 ".ltorg\n"  
);
} 

//ok
void __attribute__((naked,noinline)) sub_FF87E3F8_my(){ // 
 asm volatile(
                "LDR     R3, =0x64B4\n" 
                "LDR     R12, =0x2006\n" 
                "STMFD   SP!, {R4,LR}\n" 
                "LDR     R1, [R3,#0xC]\n" 
                "LDR     R2, [R3,#0x14]\n" 
                "CMP     R0, R12\n" 
                "BEQ     loc_FF87E46C\n" 
                "BGT     loc_FF87E438\n" 
                "SUB     R12, R0, #0x900\n" 
                "SUBS    R12, R12, #0xA2\n" 
                "BEQ     loc_FF87E490\n" 
                "SUB     R12, R0, #0x1000\n" 
                "SUBS    R12, R12, #0x51\n" 
                "BNE     loc_FF87E4B4\n" 
                "BL      sub_FF87E36C\n" 
                "B       loc_FF87E4AC\n" 
"loc_FF87E438:\n" 
                "SUB     R12, R0, #0x3000\n" 
                "SUBS    R12, R12, #7\n" 
                "BEQ     loc_FF87E4A8\n" 
                "SUB     R12, R0, #0x3100\n" 
                "SUBS    R12, R12, #0x4B\n" 
                "BNE     loc_FF87E4B4\n" 
                "CMP     R2, #0\n" 
                "BNE     loc_FF87E4AC\n" 
                "LDR     R0, [R3,#8]\n" 
                "ORRS    R0, R0, R1\n" 
                "BEQ     loc_FF87E478\n" 
                "BL      sub_FF87DD8C_my\n" // _EntryActionOnPreMoving------------>
                "B       loc_FF87E4AC\n" 
"loc_FF87E46C:\n" 
                "CMP     R2, #0\n" 
                "BLEQ    sub_FF87C9E4\n" 
                "B       loc_FF87E4AC\n" 
"loc_FF87E478:\n" 
                "LDR     R0, [R3,#4]\n" 
                "CMP     R0, #0\n" 
                "MOVNE   R0, #3\n" 
                "BNE     loc_FF87E4A0\n" 
                "BL      sub_FF87E34C\n" 
                "B       loc_FF87E4AC\n" 
"loc_FF87E490:\n" 
                "CMP     R1, #0\n" 
                "BNE     loc_FF87E4AC\n" 
                "BL      sub_FF828D44\n"	//SSAPI.CancelPrepare
                "MOV     R0, #2\n" 
"loc_FF87E4A0:\n" 
                "BL      sub_FF87E264\n" 	//MovieState
                "B       loc_FF87E4AC\n" 
"loc_FF87E4A8:\n" 
                "BL      sub_FF87E384\n" 
"loc_FF87E4AC:\n" 
                "MOV     R0, #0\n" 
                "LDMFD   SP!, {R4,PC}\n" 
"loc_FF87E4B4:\n" 
                "MOV     R0, #1\n" 
                "LDMFD   SP!, {R4,PC}\n" 
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF87DD8C_my(){  // _EntryActionOnPreMoving
 asm volatile(         
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFF87E080\n" // a_entryaction_0 ; "_EntryActionOnPreMoving" 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "LDR     R4, =0x64B4\n"
                "LDR     R0, [R4,#0x10]\n"
                "CMP     R0, #0\n"
                "LDMEQFD SP!, {R4,LR}\n"
                "BEQ     sub_FF87E320_my\n" // _EntryActionOnMoving -------->
                "LDR     R1, =0xFF87E09C\n" // a_entryactionon 
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n"
                "BL      sub_FF95D140\n"
                "LDR     R0, [R4,#0x18]\n"
                "CMP     R0, #1\n"
                "MOVNE   R0, #1\n"
                "STRNE   R0, [R4,#0x18]\n"
                "BLNE    sub_FF8731F0\n"	//LockMainPower
                "MOV     R0, #9\n"
                "BL      sub_FF87E264\n"	//MovieState
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FF95BCE8\n"
	);
} 

//ok
void __attribute__((naked,noinline)) sub_FF87E320_my(){  //_EntryActionOnMoving
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFF87E4D4\n" //a_entryaction_1  
                "MOV     R0, #0x60\n"
                "BL      sub_FF86DA00\n" 
                "LDR     R1, =0x64B4\n" 
                "MOV     R0, #0\n"
                "STR     R0, [R1,#0xC]\n"
                "MOV     R0, #4\n"
                "BL      sub_FF87E264\n" 
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FF87DA5C_my\n" // ------------->
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF87DA5C_my(){ // 
 asm volatile(                                            
                 "STMFD   SP!, {R3-R5,LR}\n"
                 "LDR     R4, =0x6470\n"
                 "LDR     R0, [R4,#0x40]\n"
                 "CMP     R0, #1\n"
                 "BEQ     loc_FF87DAA4\n"
                 "BL      sub_FF873C88\n"
                 "SUB     R12, R0, #0xA00\n"
                 "SUBS    R12, R12, #0x29\n"
                 "MOV     R5, #1\n"
                 "BNE     loc_FF87DA9C\n"
                 "LDR     R0, =0x804F\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "BL      sub_FF955D94\n" 
                 "STR     R5, [R4,#0x40]\n"
                 "B       loc_FF87DAA4\n"

 "loc_FF87DA9C:\n"     
                 "STR     R5, [R4,#0x40]\n"
                 "BL      sub_FF8731F0\n" 

 "loc_FF87DAA4:\n"                            
                 "MOV     R1, #0\n"
                 "MOV     R0, #0x80\n"
                 "BL      sub_FF87E814\n"
                 "MOV     R2, #2\n"
                 "MOV     R1, SP\n"
                 "MOV     R0, #0x6B\n"
                 "BL      sub_FF86F768\n" 
                 "MOV     R2, #2\n"
                 "MOV     R1, SP\n"
                 "MOV     R0, #0xA3\n"
                 "BL      sub_FF86F660\n" 
                 "BL      sub_FF85E628\n"
                 "BL      sub_FF87CC6C\n"
                 "BL      sub_FF82911C_my\n" // SSAPI.RecordMovie------->
                 "BL      sub_FF87D37C\n"
                 "LDMFD   SP!, {R3-R5,PC}\n"
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF82911C_my(){  // SSAPI.RecordMovie
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "MOV     R4, R0\n"
                "MOV     R0, #0x20\n"
                "LDR     R1, =0xFF829240\n" // aSsapiRecordmov 
                "BL      sub_FF86DA00\n" 
                "BL      sub_FF8298FC\n" 
                "CMP     R0, #0\n"
                "LDMNEFD SP!, {R4,PC}\n"
                "MOV     R0, #4\n"
                "BL      sub_FF85B94C\n" 
                "BL      sub_FF85FE5C\n" 
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FF86280C_my\n" //  ----------------->
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF86280C_my(){ // 
 asm volatile( 
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R8, R0\n"
                "MOV     R0, #0x41\n"
                "SUB     SP, SP, #0x38\n"
                "MOV     R5, #0\n"
                "STR     R0, [SP,#0x34]\n"
                "BL      sub_FF8627DC\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0x13B\n"
                "BNE     loc_FF8629B8\n"
                "LDR     R4, =0x5880\n"
                "MOV     R1, #0x1E\n"
                "LDR     R0, [R4,#0xC]\n"
                "BL      sub_FF829D60\n"
                "BL      sub_FF86F8F8\n"
                "STR     R0, [R4,#4]\n"
                "MOV     R0, #0\n"
                "BL      sub_FF86BA3C\n"		//GetTimeOfSystem_im1
                "STR     R0, [SP,#0x28]\n"
                "ADD     R0, SP, #0x28\n"
                "MOV     R1, SP\n"
                "BL      sub_FF86B538\n"
                "MOV     R0, SP\n"
                "BL      sub_FF86B420\n"
                "STR     R0, [SP,#0x2C]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x2C\n" 
                "MOV     R1, #0x34\n"
                "BL      sub_FF86FC18\n"
                "LDR     R7, [SP,#0x2C]\n"
                "BL      sub_FF862D34\n"
                "MOV     R6, #0\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "STR     R6, [SP,#0x2C]\n"
                "STR     R6, [SP,#0x28]\n"
                "BL      sub_FF8331F4\n"		//GetAvControlLimit
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0x2F\n"
                "BL      sub_FF86FC18\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x28\n"
                "MOV     R1, #0x2D\n"
                "BL      sub_FF86FC18\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "BL      sub_FF836954\n"		//GetAvControlLimitWithoutTv
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0x30\n"
                "BL      sub_FF86FC18\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "BL      sub_FF8339B8\n"		//GetTvControlLimit
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x28\n"
                "MOV     R1, #0x2E\n"
                "BL      sub_FF86FC18\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0xB8\n"
                "BL      sub_FF86FCC4\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x11D\n"
                "LDRNE   R0, =0xFF862C30\n" 	//aSsmovierec_c
                "BLNE    sub_FF81BFC8\n" 		// DebugAssert
                "LDRH    R0, [SP,#0x2C]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x28\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #1\n"
                "STR     R0, [SP,#0x28]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R1, #0x92\n"
                "BL      sub_FF86FC18\n"
                "MOV     R2, #1\n"
                "ADD     R1, SP, #0x34\n"
                "MOV     R0, #0xFA\n"
                "BL      sub_FF86F768\n"		//PT_GetPropertyCaseString
                "TST     R0, #1\n"
                "LDRNE   R1, =0x152\n"
                "LDRNE   R0, =0xFF862C30\n" 	// "SsMovieRec.c" 
                "BLNE    sub_FF81BFC8\n" 		// DebugAssert ****
                "LDRB    R0, [SP,#0x34]\n"
                "MOV     R3, R8\n"
                "MOV     R2, #0x14\n"
                "AND     R1, R0, #0xFF\n"
                "ADD     R0, SP, #0x30\n"
                "STR     R7, [SP]\n"
                "BL      sub_FF918954\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x156\n"
                "BNE     loc_FF8629B8\n"
                "LDR     R0, =0x1E430\n"
                "LDR     R1, [SP,#0x30]\n"
                "MOV     R2, #0x10\n"
                "BL      sub_FF90BD78\n"
                "TST     R0, #1\n"
                "BEQ     loc_FF8629C8\n"
                "LDR     R1, =0x15E\n"
"loc_FF8629B8:\n"
                "LDR     R0, =0xFF862C30\n" // ; "SsMovieRec.c" 
                "BL      sub_FF81BFC8\n" 	// DebugAssert
"loc_FF8629C0:\n"
                "ADD     SP, SP, #0x38\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FF8629C8:\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x30\n"
                "MOV     R1, #0x2B\n"
                "BL      sub_FF86FC18\n"
                "BL      sub_FF87FD70\n"
                "LDRSB   R1, [SP,#0x34]\n"
                "CMP     R0, R1\n"
                "MOVEQ   R7, #0\n"
                "BEQ     loc_FF862A1C\n"
                "LDR     R5, =0x1E430\n"
                "MOV     R0, R5\n"
                "BL      sub_FF87FEEC\n"
                "MOV     R8, R0\n"
                "BL      sub_FF8BD498\n"
                "CMP     R8, R0\n"
                "MOV     R7, R0\n"
                "LDRLS   R1, =0x16B\n"
                "LDRLS   R0, =0xFF862C30\n" // ; "SsMovieRec.c" 
                "BLLS    sub_FF81BFC8\n"	// DebugAssert
                "SUB     R7, R8, R7\n"
"loc_FF862A1C:\n"
                "BL      sub_FF85D5C8_my\n" // taskcreate_MovieRecord----------------------->
                "LDR     R0, =0x1E454\n"
                "LDRH    R3, [R0,#0x4E]\n"
                "LDRH    R2, [R0,#0x4C]\n"
                "LDR     R1, [R0,#0x48]\n"
                "LDR     R0, [R0,#0x44]\n"
                "BL      sub_FF85C44C\n"
                "MOV     R3, #0\n"
                "LDR     R2, =0xFF8627A4\n"
                "MOV     R1, #0\n"
                "LDR     R0, =0xFF8627B8\n"
                "ADD     R8, SP, #0x0c\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R2, =0xFF8627C8\n"
                "LDR     R1, =0xFF8627B4\n"
                "STMEA   SP, {R1-R3}\n"
                "LDR     R1, [R4,#4]\n"
                "MOV     R3, R6\n"
                "MOV     R2, R7\n"
                "MOV     R0, R5\n"
                "BL      sub_FF85C7C8\n"
                "LDR     R0, [R4,#0xC]\n"
                "MOV     R1, #0x20\n"
                "BL      sub_FF829D2C\n"
                "B       loc_FF8629C0\n"
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF85D5C8_my(){   // taskcreate_MovieRecord 
 asm volatile(
                "STMFD   SP!, {R3-R9,LR}\n"
                "LDR     R5, =0x56D8\n"			//**
                "MOV     R6, #0\n"
                "STR     R6, [R5,#0x24]\n"
                "LDR     R0, [R5,#8]\n"
                "LDR     R8, =0x2710\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF85D680\n"
                "MOV     R0, #1\n"
                "STR     R0, [R5,#8]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FF81BE44\n"
                "STR     R0, [R5,#0x14]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FF81BE44\n"
                "STR     R0, [R5,#0x18]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FF81BDFC\n"
                "STR     R0, [R5,#0x1C]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FF81BDFC\n"
                "LDR     R7, =0x1DF58\n"
                "MOV     R4, #9\n"
                "ADD     R9, R4, #0x2D4\n"
                "STR     R0, [R5,#0x20]\n"
"loc_FF85D63C:\n"
                "RSB     R0, R4, R4,LSL#3\n"
                "STR     R6, [R7,R0,LSL#2]\n"
                "ADD     R1, R7, R0,LSL#2\n"
                "STR     R9, [SP]\n"
                "LDR     R0, [R5,#0x20]\n"
				"LDR     R3, =0xFF85D7D0\n" 	// =aMovierecorder_
                "MOV     R2, R8\n"
                "BL      sub_FF81BF08\n"
                "SUBS    R4, R4, #1\n"
                "BPL     loc_FF85D63C\n"
                "MOV     R3, #0\n"
                "STR     R3, [SP]\n"			//**
				"LDR     R3, =MovieRecord_Task_my\n" // task_MovieRecord <--------
                "MOV     R2, #0x1000\n"
                "MOV     R1, #0x14\n"
				"LDR     R0, =0xFF85D7D0\n" 	// =aMovierecorder_
				"BL      sub_FF81BDC8\n" 		// KernelCreateTask
"loc_FF85D680:\n"
				"BL      sub_FF9400CC\n" 		//taskcreate_AviWrite
                "BL      sub_FF85D6E4\n"
                "MOV     R1, R0\n"
                "MOV     R0, #0xB\n"
                "ADD     R3, R0, #0x2DC\n"
                "STR     R0, [R1]\n"
                "STR     R3, [SP]\n"
                "LDR     R0, [R5,#0x1C]\n"
				"LDR     R3, =0xFF85C768\n" // aMovierecorder_ 
                "MOV     R2, R8\n"
                "BL      sub_FF81BF08\n"
                "LDMFD   SP!, {R3-R9,PC}\n"
 );
} 

//ok
void __attribute__((naked,noinline)) MovieRecord_Task_my(){ // FF85D4C0
 asm volatile(
 
                "STMFD   SP!, {R2-R8,LR}\n"
                "LDR     R8, =0x32B\n"
                "LDR     R7, =0x2710\n"
                "LDR     R4, =0x56D8\n"		//***
                "MOV     R6, #0\n"
                "MOV     R5, #1\n"
"loc_FF85D4D8:\n"
                "LDR     R0, [R4,#0x1C]\n"
                "MOV     R2, #0\n"
                "ADD     R1, SP, #0x4\n"
                "BL      sub_FF829FB0\n"
                "LDR     R0, [R4,#0x24]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FF85D5A8\n"
                "LDR     R0, [SP,#4]\n"
                "LDR     R1, [R0]\n"
                "SUB     R1, R1, #2\n"
                "CMP     R1, #9\n"
                "ADDLS   PC, PC, R1,LSL#2\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D50C:\n"
                "B       loc_FF85D55C\n"
"loc_FF85D510:\n"
                "B       loc_FF85D57C\n"
"loc_FF85D514:\n"
                "B       loc_FF85D58C\n"
"loc_FF85D518:\n"
                "B       loc_FF85D594\n"
"loc_FF85D51C:\n"
                "B       loc_FF85D564\n"
"loc_FF85D520:\n"
                "B       loc_FF85D59C\n"
"loc_FF85D524:\n"
                "B       loc_FF85D56C\n"
"loc_FF85D528:\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D52C:\n"
                "B       loc_FF85D5A4\n"
"loc_FF85D530:\n"
                "B       loc_FF85D534\n"
"loc_FF85D534:\n"
                "LDR     R0, =0xFF85D180\n" // nullsub_192
                "STR     R6, [R4,#0x38]\n"
                "STR     R0, [R4,#0xA4]\n"
                "LDR     R0, =0xFF85CABC\n"
                "LDR     R2, =0xFF85C9D8\n"
                "LDR     R1, =0x1E080\n"
                "STR     R6, [R4,#0x28]\n"
                "BL      sub_FF83D8B4\n"
                "STR     R5, [R4,#0x3C]\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D55C:\n"
                "BL      unlock_optical_zoom\n"		//--------------->
                "BL      sub_FF85D278\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D564:\n"
                //"BL      sub_FF85CF18\n"
                "BL      sub_FF85CF18_my\n"  	// --------------->
                "B       loc_FF85D5A8\n"
"loc_FF85D56C:\n"
                "LDR     R1, [R0,#0x10]\n"
                "LDR     R0, [R0,#4]\n"
                "BL      sub_FF940D08\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D57C:\n"
                "LDR     R0, [R4,#0x3C]\n"
                "CMP     R0, #5\n"
                "STRNE   R5, [R4,#0x2C]\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D58C:\n"
                "BL      sub_FF85CCA8\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D594:\n"
                "BL      sub_FF85CB08\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D59C:\n"
                "BL      sub_FF85C964\n"
                "B       loc_FF85D5A8\n"
"loc_FF85D5A4:\n"
                "BL      sub_FF85D710\n"
"loc_FF85D5A8:\n"
                "LDR     R1, [SP,#0x04]\n"
                "STR     R6, [R1]\n"
                "LDR     R3, =0xFF85C768\n"	//aMovierecorder_ 
                "MOV     R2, R7\n"
                "STR     R8, [SP]\n"
                "LDR     R0, [R4,#0x20]\n"	//**
                "BL      sub_FF81BF08\n"	//**
                "B       loc_FF85D4D8\n"
 );
} 


void __attribute__((naked,noinline)) sub_FF85CF18_my(){  // 
 asm volatile(   
                "STMFD   SP!, {R4-R9,LR}\n"
                "SUB     SP, SP, #0x3C\n"
                "MOV     R7, #0\n"			//**
                "LDR     R5, =0x56D8\n"
                "MOV     R4, R0\n"
                "STR     R7, [SP,#0x2C]\n"
                "STR     R7, [SP,#0x24]\n"
                "LDR     R0, [R5,#0x3C]\n"
                "MOV     R8, #4\n"
                "CMP     R0, #3\n"
                "STREQ   R8, [R5,#0x3C]\n"
                "LDR     R0, [R5,#0xA4]\n"
                "MOV     R6, #0\n"			//**
                //"BLX     R0\n"
                ".long   0xE12FFF30\n" 
                "LDR     R0, [R5,#0x3C]\n"
                "CMP     R0, #4\n"
                "BNE     loc_FF85D028\n"
                "LDRH    R0, [R5,#2]\n"
                "MOV     R9, #1\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF85CF94\n"
                "LDRH    R1, [R5,#4]\n"
                "LDR     R0, [R5,#0x4C]\n"
                "MUL     R0, R1, R0\n"
                "MOV     R1, #0x3E8\n"
                "BL      sub_FFABECA8\n"
                "MOV     R1, R0\n"
                "LDR     R0, [R5,#0x54]\n"
                "BL      sub_FFABECA8\n"
                "CMP     R1, #0\n"
                "BNE     loc_FF85CFB0\n"
"loc_FF85CF94:\n"
                "ADD     R3, SP, #0x24\n"
                "ADD     R2, SP, #0x28\n"
                "ADD     R1, SP, #0x2C\n"
                "ADD     R0, SP, #0x30\n"
                "BL      sub_FF940E9C\n"
                "MOVS    R6, R0\n"
                "BNE     loc_FF85CFCC\n"
"loc_FF85CFB0:\n"
                "LDR     R0, [R5,#0x2C]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF85D030\n"
                "LDR     R0, [R5,#0x54]\n"
                "LDR     R1, [R5,#0x40]\n"
                "CMP     R0, R1\n"
                "BCC     loc_FF85D030\n"
"loc_FF85CFCC:\n"
                "CMP     R6, #0x80000001\n"		//**
                "STREQ   R8, [R5,#0x58]\n"
                "BEQ     loc_FF85D004\n"
                "CMP     R6, #0x80000003\n"		//**
                "STREQ   R9, [R5,#0x58]\n"
                "BEQ     loc_FF85D004\n"
                "CMP     R6, #0x80000005\n"		
                "MOVEQ   R0, #2\n"
                "BEQ     loc_FF85D000\n"
                "CMP     R6, #0x80000007\n"		//**
                "STRNE   R7, [R5,#0x58]\n"
                "BNE     loc_FF85D004\n"
                "MOV     R0, #3\n"
"loc_FF85D000:\n"
                "STR     R0, [R5,#0x58]\n"
"loc_FF85D004:\n"
                "LDR     R0, =0x1E0B0\n"
                "LDR     R0, [R0,#8]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF85D01C\n"
                "BL      sub_FF84ACE4\n"
                "B       loc_FF85D020\n"
"loc_FF85D01C:\n"
                "BL      sub_FF85C964\n"
"loc_FF85D020:\n"
                "MOV     R0, #5\n"
                "STR     R0, [R5,#0x3C]\n"
"loc_FF85D028:\n"
                "ADD     SP, SP, #0x3C\n"
                "LDMFD   SP!, {R4-R9,PC}\n"
"loc_FF85D030:\n"
                "LDR     R12, [SP,#0x2C]\n"
                "CMP     R12, #0\n"
                "BEQ     loc_FF85D128\n"
                "STR     R9, [R5,#0x30]\n"
                "LDR     R0, [R5,#0x48]\n"
                "CMP     R0, #4\n"
                "LDRNE   LR, [R4,#0xC]\n"
                "BNE     loc_FF85D070\n"
                "LDR     R0, [R4,#0xC]\n"
                "LDR     R1, [R4,#8]\n"
                "MOV     R2, R0,LSR#3\n"
                "MUL     R1, R2, R1\n"
                "LDR     R2, [R4,#4]\n"
                "SUB     LR, R0, R0,LSR#2\n"
                "ADD     R1, R2, R1,LSL#1\n"
                "STR     R1, [R4,#4]\n"
"loc_FF85D070:\n"
                "LDR     R0, [R5,#0x70]\n"
                "LDR     R1, [R4,#0x14]\n"
                "LDR     R2, [R4,#0x18]\n"
                "ADD     R3, SP, #0x34\n"
                "ADD     R6, SP, #0x14\n"
                "STMIA   R6, {R0-R3}\n"
                "LDR     R0, [SP,#0x24]\n"		//**
                "LDR     R3, [R5,#0x5C]\n"
                "LDR     R1, [SP,#0x28]\n"
                "ADD     R2, SP, #0x38\n"
                "ADD     R6, SP, #0x08\n"
                "STMIA   R6, {R0,R2,R3}\n"
                "STR     R1, [SP,#0x04]\n"
                "STR     R12, [SP]\n"
                "LDMIB   R4, {R0,R1}\n"
                "LDR     R3, [SP,#0x30]\n"
                "MOV     R2, LR\n"
                "BL      sub_FF8FBD68\n"
                "LDR     R0, [R5,#0x14]\n"
                "MOV     R1, #0x3E8\n"
				"BL      sub_FF81B98C\n"	//TakeSemaphore
                "CMP     R0, #9\n"
                "BNE     loc_FF85D0DC\n"
                "BL      sub_FF941478\n"
                "MOV     R0, #0x90000\n"
                "STR     R9, [R5,#0x3C]\n"
                "B       loc_FF85D0F4\n"
"loc_FF85D0DC:\n"
                "LDR     R0, [SP,#0x34]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FF85D0FC\n"
                "BL      sub_FF941478\n"
                "MOV     R0, #0xA0000\n"
                "STR     R9, [R5,#0x3C]\n"
"loc_FF85D0F4:\n"
                "BL      sub_FF87347C\n" 	//HardwareDefect
                "B       loc_FF85D028\n"
"loc_FF85D0FC:\n"
                "BL      sub_FF8FBE2C\n"
                "LDR     R0, [SP,#0x30]\n"		//**
                "LDR     R1, [SP,#0x38]\n"
                "BL      sub_FF941220\n"
                "LDR     R0, [R5,#0x50]\n"
                "LDR     R1, =0x5748\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x50]\n"
                "LDR     R0, [SP,#0x38]\n"
                "MOV     R2, #0\n"
                //BL      sub_FF93F040
                "BL      sub_FF93F040_my\n"  // ----------------->
"loc_FF85D128:\n"
                "LDR     R0, [R5,#0x54]\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x54]\n"
                "LDR     R1, [R5,#0x7C]\n"
                "MUL     R0, R1, R0\n"
                "LDR     R1, [R5,#0x78]\n"
                "BL      sub_FFABECA8\n"
                "MOV     R4, R0\n"
                "BL      sub_FF9414B0\n"
                "LDR     R1, [R5,#0x74]\n"
                "CMP     R1, R4\n"
                "BNE     loc_FF85D164\n"
                "LDR     R0, [R5,#0x34]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FF85D178\n"
"loc_FF85D164:\n"
                "LDR     R1, [R5,#0x88]\n"
                "MOV     R0, R4\n"
                //"BLX     R1\n"
                ".long   0xE12FFF31\n"
                "STR     R4, [R5,#0x74]\n"
                "STR     R7, [R5,#0x34]\n"		//**
"loc_FF85D178:\n"
                "STR     R7, [R5,#0x30]\n"
                "B       loc_FF85D028\n"
 );
} 

//ok
void __attribute__((naked,noinline)) sub_FF93F040_my(){   // 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "LDR     R4, =0xE400\n"
                "LDR     LR, [R4]\n"
                "LDR     R2, [R4,#8]\n"
                "CMP     LR, #0\n"
                "LDRNE   R3, [R4,#0xC]\n"
                "MOV     R5, R2\n"
                "CMPNE   R3, #1\n"
                "MOVEQ   R2, #0\n"
                "STREQ   R0, [R4]\n"
                "STREQ   R2, [R4,#0xC]\n"
                "BEQ     loc_FF93F10C\n"
                "LDR     R3, [R4,#4]\n"
                "LDR     R7, =table\n"          // unk_FFADC8E8
                "ADD     R12, R3, R3,LSL#1\n"
                "LDR     R3, [R7,R12,LSL#2]\n"
                "ADD     R6, R7, #0x60\n"
                "LDR     R8, [R6,R12,LSL#2]\n"
                "SUB     R3, LR, R3\n"
                "CMP     R3, #0\n"
                "SUB     LR, LR, R8\n"
                "BLE     loc_FF93F0C8\n"
                "ADD     R12, R7, R12,LSL#2\n"
                "LDR     LR, [R12,#4]\n"
                "CMP     LR, R3\n"
                "ADDGE   R2, R2, #1\n"
                "BGE     loc_FF93F0BC\n"
                "LDR     R12, [R12,#8]\n"
                "CMP     R12, R3\n"
                "ADDLT   R2, R2, #3\n"
                "ADDGE   R2, R2, #2\n"
"loc_FF93F0BC:\n"
    //          "CMP     R2, #0x17\n"   // -
    //          "MOVGE   R2, #0x16\n"   // -
                "CMP     R2, #0x1A\n"   // +
                "MOVGE   R2, #0x19\n"   // +
                "B       loc_FF93F0FC\n"
"loc_FF93F0C8:\n"
                "CMP     LR, #0\n"
                "BGE     loc_FF93F0FC\n"
                "ADD     R3, R6, R12,LSL#2\n"
                "LDR     R12, [R3,#4]\n"
                "CMP     R12, LR\n"
                "SUBLE   R2, R2, #1\n"
                "BLE     loc_FF93F0F4\n"
                "LDR     R3, [R3,#8]\n"
                "CMP     R3, LR\n"
                "SUBGT   R2, R2, #3\n"
                "SUBLE   R2, R2, #2\n"
"loc_FF93F0F4:\n"
                "CMP     R2, #0\n"
                "MOVLT   R2, #0\n"
"loc_FF93F0FC:\n"
                "CMP     R2, R5\n"
                "STRNE   R2, [R4,#8]\n"
                "MOVNE   R2, #1\n"
                "STRNE   R2, [R4,#0xC]\n"
"loc_FF93F10C:\n"
                "LDR     R2, =CompressionRateTable\n"  
                "LDR     R3, [R4,#8]\n"
                "LDR     R2, [R2,R3,LSL#2]\n"

                "LDR     R3, =video_mode\n"      // +
                "LDR     R3, [R3]\n"             // +
                "LDR     R3, [R3]\n"             // +
                "CMP     R3, #1\n"               // +
                "LDREQ   R3, =video_quality\n"   // +     
                "LDREQ   R3, [R3]\n"             // +     
                "LDREQ   R2, [R3]\n"             // +     

                "STR     R2, [R1]\n"
                "STR     R0, [R4]\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
 );
} 


//********


#include "conf.h"

int *video_quality = &conf.video_quality;
int *video_mode    = &conf.video_mode;

long def_table[48]={
  0x2000,   0x38D,   0x788, 0x5800,  0x9C5,  0x14B8, 0x10000,  0x1C6A,  0x3C45, 0x20000,  0x387A,  0x7813,
 0x25800,  0x422F,  0x8CB6, 0x8000,  0xE35,  0x1E23, 0x10000,  0x1C6A,  0x3C45, 0x12C00,  0x2118,  0x465B,
  0x1CCD,  -0x2E1,  -0x579, 0x4F33, -0x7EB,  -0xF0C,  0xE666, -0x170A, -0x2BC6, 0x1CC39, -0x2F5B, -0x59F0,
 0x21B53, -0x377F, -0x6965, 0x7333, -0xB85, -0x15E3,  0xE666, -0x170A, -0x2BC6, 0x10DAA, -0x1BC0, -0x34B3};

long table[48];

void change_video_tables(int a, int b){
 int i;
 for (i=0;i<48;i++) table[i]=(def_table[i]*a)/b; 
}

long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
